package com.erp.pojo.purchase;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 采购计划表
 * @TableName purchase_plan
 */
@TableName(value ="purchase_plan")
@Data
public class PurchasePlan implements Serializable {
    /**
     * id
     */
    @TableId(value = "id")
    private Long id;

    /**
     * 名字
     */
    @TableField(value = "name")
    private String name;

    /**
     * 产品id
     */
    @TableField(value = "product_id")
    private Long product_id;

    /**
     * 用户id 
     */
    @TableField(value = "execute_user_id")
    private Long execute_user_id;

    /**
     * 计划开始时间
     */
    @TableField(value = "status_time")
    private Date status_time;

    /**
     * 计划交付时间
     */
    @TableField(value = "end_time")
    private Date end_time;

    /**
     * 采购数量
     */
    @TableField(value = "num")
    private Integer num;

    /**
     * 计划金额
     */
    @TableField(value = "money")
    private String money;

    /**
     * 交易地点
     */
    @TableField(value = "address")
    private String address;

    /**
     * 状态  0:未开始 1:执行中 2:完成
     */
    @TableField(value = "status")
    private Integer status;

    /**
     * 创建人id
     */
    @TableField(value = "create_user_id")
    private Long create_user_id;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date create_time;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PurchasePlan other = (PurchasePlan) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getProduct_id() == null ? other.getProduct_id() == null : this.getProduct_id().equals(other.getProduct_id()))
            && (this.getExecute_user_id() == null ? other.getExecute_user_id() == null : this.getExecute_user_id().equals(other.getExecute_user_id()))
            && (this.getStatus_time() == null ? other.getStatus_time() == null : this.getStatus_time().equals(other.getStatus_time()))
            && (this.getEnd_time() == null ? other.getEnd_time() == null : this.getEnd_time().equals(other.getEnd_time()))
            && (this.getNum() == null ? other.getNum() == null : this.getNum().equals(other.getNum()))
            && (this.getMoney() == null ? other.getMoney() == null : this.getMoney().equals(other.getMoney()))
            && (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(other.getAddress()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreate_user_id() == null ? other.getCreate_user_id() == null : this.getCreate_user_id().equals(other.getCreate_user_id()))
            && (this.getCreate_time() == null ? other.getCreate_time() == null : this.getCreate_time().equals(other.getCreate_time()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getProduct_id() == null) ? 0 : getProduct_id().hashCode());
        result = prime * result + ((getExecute_user_id() == null) ? 0 : getExecute_user_id().hashCode());
        result = prime * result + ((getStatus_time() == null) ? 0 : getStatus_time().hashCode());
        result = prime * result + ((getEnd_time() == null) ? 0 : getEnd_time().hashCode());
        result = prime * result + ((getNum() == null) ? 0 : getNum().hashCode());
        result = prime * result + ((getMoney() == null) ? 0 : getMoney().hashCode());
        result = prime * result + ((getAddress() == null) ? 0 : getAddress().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreate_user_id() == null) ? 0 : getCreate_user_id().hashCode());
        result = prime * result + ((getCreate_time() == null) ? 0 : getCreate_time().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", product_id=").append(product_id);
        sb.append(", execute_user_id=").append(execute_user_id);
        sb.append(", status_time=").append(status_time);
        sb.append(", end_time=").append(end_time);
        sb.append(", num=").append(num);
        sb.append(", money=").append(money);
        sb.append(", address=").append(address);
        sb.append(", status=").append(status);
        sb.append(", create_user_id=").append(create_user_id);
        sb.append(", create_time=").append(create_time);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}